import React , { Component } from 'react';
import { withRouter,NavLink,Switch,Redirect,Route} from 'react-router-dom';

import Home from './views/home';

import About from './views/about';
import Router from './views/router/bak.jsx';
import Web1906 from './views/web1906';
import Tab2 from './views/tab2';

// 导入info 页面
// 直接使用
// src/views/info
import Info from './views/info';

// Route
// <Route path="/weike" component={About} />

// http://localhost:3000/weike
// http://localhost:3000/about
// http://localhost:3000/ exact
// http://localhost:3000/pindao

// Route 使用  path component
// exact 精准匹配
// 非法url 要跳到哪个位置 Redirect

// 模板页面
// 排版是一样的 只是内容
// ID
// 动态url
//
// web1906 同学信息展示
// 1、同学列表
//     所有同学的姓名
// 2、每个同学详情
//     姓名：

import Com from './views/Com';
import Context from './views/Context';
import Context2 from './views/Context2';
import Input from './views/Input';
// import Com2 from './views/Com2';





class App extends Component {
    render(){
        return (
            <Switch>
                <Route exact path="/" component={Home} />

                <Route path="/about" component={About} />
                <Route path="/tab2" component={Tab2} />

                <Route exact path="/info" component={Info} />

                <Route path={`/info/:id`} component={Info} />

                <Route path="/com" component={Com} />
                <Route path="/context" component={Context} />
                <Route path="/context2" component={Context2} />
                <Route path="/input" component={Input} />

                <Route exact path="/web1906" component={Web1906} />
                <Route path={`/web1906/:id`} component={Web1906} />

                <Redirect to="/" />

            </Switch>
        );
    }
}
export default App;
